/*
//Main.js
//Author: TruongVX
$(function() {
        $( "#datepicker" ).datepicker();
      });
*/
$( document ).ready(function() {
    $(function() {
        $("#date-of-birth").datepicker({ dateFormat: "yy-mm-dd" }).val()
        $("#signed-on-date").datepicker({ dateFormat: "yy-mm-dd" }).val()
        $("#seaman-pass-exp-date").datepicker({ dateFormat: "yy-mm-dd" }).val()
        $("#intl-pass-exp-date").datepicker({ dateFormat: "yy-mm-dd" }).val()
        $("#date-rest").datepicker({ dateFormat: "yy-mm-dd" }).val()
        $("#start-date-search").datepicker({ dateFormat: "yy-mm-dd" }).val()
        $("#end-date-search").datepicker({ dateFormat: "yy-mm-dd" }).val()
    });
});
//close message
$(document).ready(function(){
    $("#close-msg").click(function(){
        $("#show-msg").hide();
    });
});

function editUser(id)
{
    //var base_url = $("#base_url").val();
    location.href = 'edit-user.html?id='+id;
}

function deleteUser(id)
{
    if (confirm("Bạn chắc chắn muốn xóa user này?")){
        location.href = $("#base_url").val()+'delete-user.html?id='+id ;
    }
}
function editCrew(crew_id)
{
    var base_url = $("#base_url").val();
    location.href = base_url+'edit-crew.html?id='+crew_id;
}

function deleteCrew(crew_id)
{
    if (confirm("Bạn chắc chắn muốn xóa nhân viên này?")){
        location.href = $("#base_url").val()+'delete-crew.html?id='+crew_id ;
    }
}

function editRestTime(id)
{
    var base_url = $("#base_url").val();
    location.href = base_url+'edit-rest-time.html?id='+id ;
}

function deleteRestTime(id)
{
    if (confirm("Bạn chắc chắn muốn xóa giờ nghỉ này?")){
        location.href = $("#base_url").val()+'delete-rest-time.html?id='+id ;
    }
}


